using System.Collections;
using TMPro;
using UnityEngine;

public class NewIntro_Manager : MonoBehaviour
{
	[SerializeField]
	private Animator HypoasterAnimator;

	[SerializeField]
	private TextMeshPro DeskNumber;

	private void Start()
	{
		if (!PlayerPrefs.HasKey("Game_DeskNumber"))
		{
			PlayerPrefs.SetInt("Game_DeskNumber", Random.Range(1, 99));
		}
		if (PlayerPrefs.GetInt("Game_DeskNumber", 0) <= 9)
		{
			DeskNumber.text = string.Format("00{0}", PlayerPrefs.GetInt("Game_DeskNumber", 0));
		}
		else
		{
			DeskNumber.text = string.Format("0{0}", PlayerPrefs.GetInt("Game_DeskNumber", 0));
		}
		StartCoroutine(StartDelay());
	}

	private IEnumerator StartDelay()
	{
		yield return new WaitForSeconds(1f);
		HypoasterAnimator.Play("NewIntro_HypoasterAwake");
		yield return new WaitForSeconds(0.5f);
		UI_FADE.Instance.StartFadeOut();
		yield return new WaitForSeconds(31f);
		UI_FADE.Instance.StartFadeIn(54, 1f);
	}
}
